<?php
$config_sql=file_get_contents("../config_sql.txt");
$arr_config_sql=  explode("!",$config_sql);

$hostname= "$arr_config_sql[1]";


$username = "$arr_config_sql[2]";


$password = "$arr_config_sql[3]";




$db = mysql_connect($hostname, $username, $password) //соединение с базой данных
        or die('connect to database failed');

		
//$table_db = 'monitoring';		
$table_db=	"$arr_config_sql[4]";
mysql_select_db($table_db) or die('db not found'); 
$count=0;
//$sql = "UPDATE `monitoring`.`uzer_devise` SET `contact` = \'(093)752-1548\' WHERE `uzer_devise`.`id` = 44;";

/* $res = mysql_query("SELECT * FROM uzer_devise WHERE contact='(067)111-2233' ORDER BY `id`");
		while($row = mysql_fetch_array($res)){
		$arrID[$count]=$row['id']; // выбираем все id у кого сонтакт (067)111-2233 
		echo $arrID[$count].":";
		$count++;
		
		}

echo $count; */

/* for($i=0; $i<$count; $i++){                      
	
	$sql = "UPDATE `monitoring`.`uzer_devise` SET `contact` = '(093)752-1548' WHERE `uzer_devise`.`id` = $arrID[$i];"; ///меняем телефон этому юзеру
	//$arrEmaiUzer[$i] = explode("#",$arrUzers[$i]);
	if (!mysql_query($sql,$db))
  {
  die('Error: ' . mysql_error());
  }
} */

//$newuser="Maxislav";


$sql = "DELETE FROM `uzer_devise` WHERE `devise_name`='al';"; 
if (!mysql_query($sql,$db))
  {
  die('Error: ' . mysql_error());
  }



mysql_close($db);
//$sql = "INSERT INTO `monitoring`.`uzer_devise` (`id`, `uzer`, `emai`, `devise_name`, `contact`) VALUES (NULL, \'$newuser\', \'$imai\', \'$user\', \'$contact');";

?>